


#pragma once


#include <sql.h>
#include <sqlext.h>


class NODBCSessionObject
{
	public:
		bool isOK(void) const;
		bool isConnect( void ) const;
		bool Connect( void );
		void Disconnect( void );
		operator SQLHDBC() { return m_hDbc; };
		string GetName( void ) const{ return m_Name; };

	private:
		bool Init(void);

	public:
		explicit NODBCSessionObject( const string in_Name, const string in_ConnectionStr );
		virtual ~NODBCSessionObject();

	private:
		const string m_Name;
		const string m_ConnectionStr;
		bool		 m_bOK;
		SQLHENV		 m_hEnv;
		SQLHDBC		 m_hDbc;
};


